package com.zxb.core.auth;

import lombok.AllArgsConstructor;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author Zxb
 */
@Aspect
@Component
@AllArgsConstructor
public class SafeAspect {

	private AuthValidator authValidator;

    @Pointcut("@annotation(com.zxb.core.auth.Safe)")
    public void pointCut(){}

    @Before("pointCut()")
    public void beforePreSafe(){
    	authValidator.safe();
    }
}
